{% extends '@SyliusShop/layout.html.twig' %}

{% form_theme form '@SyliusUi/Form/theme.html.twig' %}

{% set product = product_review.reviewSubject %}

{% block content %}
    <div class="ui hidden divider"></div>
    <div class="ui stackable grid" id="reviews">
        <div class="four wide column">
            {{ sonata_block_render_event('sylius.shop.product_review.create.before_product_box', {'product_review': product_review}) }}

            {% include '@SyliusShop/Product/_box.html.twig' %}

            {{ sonata_block_render_event('sylius.shop.product_review.create.after_product_box', {'product_review': product_review}) }}
        </div>
        <div class="twelve wide column">
            <div class="ui segment">
                <div class="ui dividing header">
                    {{ 'sylius.ui.write_your_own_review'|trans }}
                    <div class="sub header">
                        {{ 'sylius.ui.you_are_reviewing'|trans }} <strong>{{ product.name }}</strong>.
                    </div>
                </div>

                {{ sonata_block_render_event('sylius.shop.product_review.create.before_form', {'product_review': product_review}) }}

                {{ form_start(form, {'action': path('sylius_shop_product_review_create', {'slug': product.slug, '_locale': product.translation.locale}), 'attr': {'class': 'ui loadable reply form', 'novalidate': 'novalidate'}}) }}
                    {% include '@SyliusShop/ProductReview/_form.html.twig' %}

                    {{ sonata_block_render_event('sylius.shop.product_review.create.form', {'product_review': product_review, 'form': form}) }}

                    {{ form_row(form._token) }}
                    <button type="submit" class="ui blue labeled large icon submit button">
                        <i class="icon check"></i> {{ 'sylius.ui.add'|trans }}
                    </button>
                {{ form_end(form, {'render_rest': false}) }}
            </div>
        </div>
    </div>
{% endblock %}
